package com.zhangxin.designmode.oop.demo3.abstractdemo;

import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.logging.Level;

/**
 * @author zhangxin
 * @date 2022/4/6
 */
public class FileLogger extends AbstractLogger {

    private Writer writer;

    public FileLogger(String name, boolean enabled, Level minPermittedLevel, String filePath) throws IOException {
        super(name, enabled, minPermittedLevel);
        this.writer = new FileWriter(filePath);
    }

    @Override
    protected void doLog(Level level, String message) throws IOException {
        //格式化level 和 message
        String formatStr = "";
        writer.write(formatStr);
    }
}
